home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / editors / mntemacs.zoo / src / ymakefile < prev   
Encoding:
Makefile  |  1992-04-29  |  14.4 KB  |  488 lines

  1. /* Makefile for GNU Emacs.
  2.    Copyright (C) 1985, 1987, 1988, 1990 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU Emacs.
  5.  
  6. GNU Emacs is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 1, or (at your option)
  9. any later version.
  10.  
  11. GNU Emacs is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU Emacs; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20.  
  21. dot = .
  22. /* on Xenix, replace double-dot below with $(dot)$(dot) */
  23. lispdir = $(dot)$(dot)/lisp/
  24. etcdir = $(dot)$(dot)/etc/
  25. shortnamesdir = $(dot)$(dot)/shortnames/
  26. cppdir = $(dot)$(dot)/cpp/
  27. oldXMenudir = $(dot)$(dot)/oldXMenu/
  28.  
  29. #define NO_SHORTNAMES
  30. #include "config.h"
  31.  
  32. /* Use HAVE_X11 as an alias for X11 in this file
  33.    to avoid problems with X11 as a subdirectory name
  34.    in -I and other such options which pass through this file. */
  35.  
  36. #ifdef X11
  37. #define HAVE_X11
  38. #undef X11
  39. #endif
  40.  
  41. /* On some machines #define register is done in config;
  42.    don't let it interfere with this file.  */
  43. #undef register
  44.  
  45. /* Some machines don't find the standard C libraries in the usual place.  */
  46. #ifndef LIB_STANDARD
  47. #define LIB_STANDARD -lc
  48. #endif
  49.  
  50. /* Unless inhibited or changed, use -lg to link for debugging.  */
  51. #ifndef LIBS_DEBUG
  52. #define LIBS_DEBUG -lg
  53. #endif
  54.  
  55. /* Some s- files define this to request special libraries.  */
  56. #ifndef LIBS_SYSTEM
  57. #define LIBS_SYSTEM
  58. #endif
  59.  
  60. /* Some m- files define this to request special libraries.  */
  61. #ifndef LIBS_MACHINE
  62. #define LIBS_MACHINE
  63. #endif
  64.  
  65. /* Some s- files define this to request special switches in ld.  */
  66. #ifndef LD_SWITCH_SYSTEM
  67. #if defined (BSD) && !defined (COFF)
  68. #define LD_SWITCH_SYSTEM -X
  69. #else
  70. #define LD_SWITCH_SYSTEM
  71. #endif /* COFF, or not BSD */
  72. #endif
  73.  
  74. /* Some m- files define this to request special switches in ld.  */
  75. #ifndef LD_SWITCH_MACHINE
  76. #define LD_SWITCH_MACHINE
  77. #endif
  78.  
  79. /* Some m- files define this to request special switches in cc.  */
  80. #ifndef C_SWITCH_MACHINE
  81. #define C_SWITCH_MACHINE
  82. #endif
  83.  
  84. #ifndef C_SWITCH_SYSTEM
  85. #define C_SWITCH_SYSTEM
  86. #endif
  87.  
  88. #ifndef START_FILES
  89. #ifdef NO_REMAP
  90. #define START_FILES pre-crt0.o /lib/crt0.o
  91. #else
  92. #define START_FILES crt0.o
  93. #endif
  94. #endif /* have START_FILES */
  95. STARTFILES = START_FILES
  96.  
  97. /* Unless inhibited or changed, use -g to compile for debugging.  */
  98. #ifndef C_DEBUG_SWITCH
  99. #define C_DEBUG_SWITCH -g
  100. #endif
  101.  
  102. /* If user wants to optimize, this is how.  */
  103. #ifndef C_OPTIMIZE_SWITCH
  104. #define C_OPTIMIZE_SWITCH -O
  105. #endif
  106.  
  107. /* cc switches needed to make `asm' keyword work.
  108.    Nothing special needed on most machines.  */
  109. #ifndef C_SWITCH_ASM
  110. #define C_SWITCH_ASM
  111. #endif
  112.  
  113. /* Specify address for ld to start loading at,
  114.    if requested by configuration.  */
  115.  
  116. #ifdef LD_TEXT_START_ADDR
  117. STARTFLAGS = -T LD_TEXT_START_ADDR -e __start
  118. #endif
  119.  
  120. #ifndef LINKER
  121. #define LINKER ld
  122. #endif
  123. LD=LINKER
  124. LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_MACHINE
  125.  
  126. /* Figure out whether the system cpp can handle long names.
  127.    Do it by testing it right now.
  128.    If it loses, arrange to use the GNU cpp.  */
  129.  
  130. #define LONGNAMEBBBFOOX
  131. #ifdef LONGNAMEBBBARFOOX
  132. /* Installed cpp fails to distinguish those names!  */
  133. /* Arrange to compile the GNU cpp later on */
  134. #define NEED_CPP
  135. /* Cause cc to invoke the cpp that comes with Emacs,
  136.    which will be in a file named localcpp.  */
  137. MYCPPFLAG= -Blocal
  138. /* LOCALCPP is the local one or nothing.
  139.    CPP is the local one or the standardone.  */
  140. LOCALCPP= localcpp
  141. #endif /* NEED_CPP */
  142.  
  143. #ifdef SHORTNAMES
  144. SHORT= shortnames
  145. #endif /* SHORTNAMES */
  146.  
  147. CFLAGS= C_DEBUG_SWITCH C_OPTIMIZE_SWITCH -Demacs $(MYCPPFLAG) C_SWITCH_MACHINE C_SWITCH_SYSTEM
  148. /* DO NOT use -R.  There is a special hack described in lastfile.c
  149.    which is used instead.  Some initialized data areas are modified
  150.    at initial startup, then labeled as part of the text area when
  151.    Emacs is dumped for the first time, and never changed again. */
  152.  
  153. /* You may replace C_DEBUG_SWITCH with C_OPTIMIZE_SWITCH
  154.    if you don't believe in debugging. */
  155.  
  156. /* -Demacs is needed to make some files produce the
  157.    correct version for use in Emacs.  */
  158.  
  159. #ifndef LIBX10_MACHINE
  160. #define LIBX10_MACHINE
  161. #endif
  162.  
  163. #ifndef LIBX11_MACHINE
  164. #define LIBX11_MACHINE
  165. #endif
  166.  
  167. #ifndef LIBX10_SYSTEM
  168. #define LIBX10_SYSTEM
  169. #endif
  170.  
  171. #ifndef LIBX11_SYSTEM
  172. #define LIBX11_SYSTEM
  173. #endif
  174.  
  175. #ifndef LIB_X11_LIB
  176. #define LIB_X11_LIB -lX11
  177. #endif
  178.  
  179. #ifdef HAVE_X_WINDOWS
  180. #ifdef HAVE_X11
  181. #ifdef HAVE_X_MENU
  182. OLDXMENU = libXMenu11.a
  183. XOBJ = x11term.o x11fns.o xmenu.o
  184. LIBX = $(OLDXMENU) -loldX LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
  185. #else
  186. XOBJ = x11term.o x11fns.o
  187. LIBX = LIB_X11_LIB LIBX11_MACHINE LIBX11_SYSTEM
  188. #endif
  189. #else /* not HAVE_X11 */
  190. #ifdef HAVE_X_MENU
  191. XOBJ= xterm.o xfns.o xmenu.o
  192. LIBX= -lXMenu -lX LIBX10_MACHINE LIBX10_SYSTEM
  193. #else
  194. XOBJ= xterm.o xfns.o
  195. LIBX= -lX LIBX10_MACHINE LIBX10_SYSTEM
  196. #endif /* not HAVE_X_MENU */
  197. #endif /* not HAVE_X11 */
  198. #endif /* HAVE_X_WINDOWS */
  199.  
  200. /* Fix linking if compiled with GCC.  */
  201. #ifdef __GNUC__
  202. #ifndef LIB_GCC
  203. #define LIB_GCC /usr/local/lib/gcc-gnulib
  204. #endif
  205. GNULIB_VAR = `if [ -f LIB_GCC ] ; then echo LIB_GCC; else echo; fi`
  206. #else
  207. GNULIB_VAR = 
  208. #endif
  209.  
  210. #ifdef MAINTAIN_ENVIRONMENT
  211. environobj = environ.o
  212. #endif MAINTAIN_ENVIRONMENT
  213.  
  214. /* Allow config.h to specify a replacement file for unexec.c.  */
  215. #ifndef UNEXEC
  216. #define UNEXEC unexec.o
  217. #endif
  218.  
  219. /* lastfile must follow all files
  220.    whose initialized data areas should be dumped as pure by dump-emacs. */
  221. obj=    dispnew.o scroll.o xdisp.o window.o \
  222.     term.o cm.o $(XOBJ) \
  223.     emacs.o keyboard.o macros.o keymap.o sysdep.o \
  224.     buffer.o filelock.o insdel.o marker.o \
  225.     minibuf.o fileio.o dired.o filemode.o \
  226.     cmds.o casefiddle.o indent.o search.o regex.o undo.o \
  227.     alloc.o data.o doc.o editfns.o callint.o \
  228.     eval.o fns.o print.o lread.o \
  229.     abbrev.o syntax.o UNEXEC mocklisp.o bytecode.o \
  230.     process.o callproc.o $(environobj) \
  231.     doprnt.o
  232.  
  233. #ifdef TERMINFO
  234. /* Used to be -ltermcap here.  If your machine needs that,
  235.    define LIBS_TERMCAP in the m- file.  */
  236. #ifndef LIBS_TERMCAP
  237. #define LIBS_TERMCAP -lcurses
  238. #endif
  239. termcapobj = terminfo.o
  240. #else
  241. #ifndef LIBS_TERMCAP
  242. #define LIBS_TERMCAP
  243. termcapobj = termcap.o tparam.o
  244. #else
  245. termcapobj = tparam.o
  246. #endif
  247. #endif
  248.  
  249. #ifndef SYSTEM_MALLOC
  250. #ifdef HAVE_ALLOCA
  251. mallocobj = malloc.o
  252. #else
  253. mallocobj = alloca.o malloc.o
  254. #endif
  255. #else /* SYSTEM_MALLOC */
  256. #ifndef HAVE_ALLOCA
  257. mallocobj = alloca.o
  258. #endif
  259. #endif
  260.  
  261. /* define otherobj as list of object files that make-docfile
  262.    should not be told about.  */
  263. otherobj= $(termcapobj) lastfile.o $(mallocobj)
  264.  
  265. /* List of Lisp files loaded into the dumped Emacs. */
  266. lisp=    ${lispdir}simple.elc ${lispdir}help.elc \
  267.     ${lispdir}files.elc ${lispdir}window.elc \
  268.     ${lispdir}indent.elc ${lispdir}loaddefs.el ${lispdir}paths.el \
  269.     ${lispdir}startup.elc ${lispdir}lisp.elc \
  270.     ${lispdir}page.elc ${lispdir}register.elc \
  271.     ${lispdir}paragraphs.elc ${lispdir}lisp-mode.elc \
  272.     ${lispdir}text-mode.elc ${lispdir}fill.elc \
  273.     ${lispdir}c-mode.elc ${lispdir}isearch.elc \
  274.     ${lispdir}replace.elc ${lispdir}abbrev.elc \
  275.     ${lispdir}buff-menu.elc ${lispdir}subr.elc
  276.  
  277. /* just to be sure the sh is used */
  278. SHELL=/bin/sh
  279.  
  280. /* Construct full set of libraries to be linked.  */
  281. LIBES = LIBS_TERMCAP $(LIBX) LIBS_SYSTEM LIBS_MACHINE LIBS_DEBUG LIB_STANDARD $(GNULIB_VAR)
  282.  
  283. /* Enable recompilation of certain other files depending on system type.  */
  284.  
  285. #ifndef OTHER_FILES
  286. #define OTHER_FILES
  287. #endif
  288.  
  289. /* Enable inclusion of object files in temacs depending on system type.  */
  290. #ifndef OBJECTS_SYSTEM
  291. #define OBJECTS_SYSTEM
  292. #endif
  293.  
  294. #ifndef OBJECTS_MACHINE
  295. #define OBJECTS_MACHINE
  296. #endif
  297.  
  298. all: xemacs OTHER_FILES
  299.  
  300. xemacs: temacs ${etcdir}DOC ${lisp}
  301. #ifdef atarist
  302.     ./temacs -batch -l inc-vers
  303.     bash -c "./temacs -batch -l loadup.el dump"
  304.     mv xemacs xemacs.1
  305.     bash -c "bash -c \"./temacs -batch -l loadup.el dump\""
  306.     mv xemacs xemacs.2
  307.     ../utils/dumpfix -n xemacs.1 xemacs.2 xemacs
  308.     rm -f xemacs.1 xemacs.2
  309. #else
  310. #ifdef HAVE_SHM
  311.     ./temacs -nl -batch -l inc-vers
  312.     ./temacs -nl -batch -l loadup dump
  313.     ln temacs xemacs
  314. #else
  315. #ifdef CANNOT_DUMP
  316.     mv temacs xemacs
  317. #else
  318.     ./temacs -batch -l inc-vers
  319.     ./temacs -batch -l loadup.el dump
  320. #endif /* not CANNOT_DUMP */
  321. #endif /* not HAVE_SHM */
  322. #endif /* not atarist */
  323.  
  324. ${etcdir}DOC: ${etcdir}make-docfile ${obj} ${lisp}
  325.     rm -f ${etcdir}DOC
  326.     ${etcdir}make-docfile ${obj} ${lisp} ${lispdir}version.el > ${etcdir}DOC
  327.  
  328. ${etcdir}make-docfile:
  329.     cd ${etcdir}; make ${MFLAGS} make-docfile
  330.  
  331. /* Some systems define this to cause parallel Make-ing.  */
  332. #ifndef MAKE_PARALLEL
  333. #define MAKE_PARALLEL
  334. #endif
  335.  
  336. temacs: MAKE_PARALLEL $(LOCALCPP) $(SHORT) $(STARTFILES) $(OLDXMENU) ${obj} ${otherobj} OBJECTS_SYSTEM OBJECTS_MACHINE
  337.     $(LD) ${STARTFLAGS} ${LDFLAGS} -o temacs ${STARTFILES} ${obj} ${otherobj} OBJECTS_SYSTEM OBJECTS_MACHINE ${LIBES}
  338.  
  339. /* These are needed for C compilation, on the systems that need them */
  340. #ifdef NEED_CPP
  341. CPP = ./localcpp
  342. localcpp:
  343.     cd ${cppdir}; make ${MFLAGS} EMACS=-DEMACS
  344.     ln ${cppdir}cpp localcpp  /* Name where CFLAGS will refer to it */
  345. /* cc appears to be cretinous and require all of these to exist
  346.    if -B is specified -- we can't use one local pass and let the
  347.    others be the standard ones.  What a loser.
  348.    We can't even use ln, since they are probably
  349.    on different disks.  */
  350.     cp /lib/ccom localccom
  351.     -cp /lib/optim localoptim
  352.     -cp /lib/c2 localc2
  353.     cp /bin/as localas
  354. #else /* not NEED_CPP */
  355. CPP = $(CC) -E
  356. #endif /* need NEED_CPP */
  357.  
  358. #ifdef SHORTNAMES
  359. shortnames:
  360.     cd ${shortnamesdir}; make ${MFLAGS}
  361. #endif /* SHORTNAMES */
  362.  
  363. #ifdef HAVE_X_WINDOWS
  364. #ifdef HAVE_X_MENU
  365. #ifdef HAVE_X11
  366. $(OLDXMENU):
  367.     cd ${oldXMenudir}; make ${MFLAGS}
  368.     ln ${oldXMenudir}libXMenu11.a $(OLDXMENU)
  369. #endif /* HAVE_X11 */
  370. #endif /* HAVE_X_MENU */
  371. #endif /* HAVE_X_WINDOWS */
  372.  
  373. paths.h: paths.h-dist
  374.     @sh -c "if test -r $@; then echo $? is newer than $@; exit 1;\
  375.       else exit 0; fi"
  376.     cp $? $@
  377.  
  378. config.h: config.h-dist
  379.     @sh -c "if test -r $@; then echo $? is newer than $@; exit 1;\
  380.       else exit 0; fi"
  381.     cp $? $@
  382.  
  383. /* Some machines have alloca built-in.
  384.    They should define HAVE_ALLOCA, or may just let alloca.s
  385.    be used but generate no code.
  386.    Some have it written in assembler in alloca.s.
  387.    Some use the C version in alloca.c (these define C_ALLOCA in config.h).
  388.    */
  389.  
  390. #ifdef C_ALLOCA
  391. alloca.o : alloca.c
  392. #else
  393. #ifndef HAVE_ALLOCA
  394. alloca.o : alloca.s config.h
  395. /* $(CPP) is cc -E, which may get confused by filenames
  396.    that do not end in .c.  So copy file to a safe name.  */
  397.     cp alloca.s allocatem.c
  398. /* remove any ^L, blank lines, and preprocessor comments,
  399.    since some assemblers barf on them */
  400.     $(CPP) allocatem.c | \
  401.     sed -e 's/ //' -e 's/^#.*//' | \
  402.     sed -n -e '/^..*$$/p' > allocatem.s
  403.     -rm -f alloca.o
  404. /* Xenix, in particular, needs to run assembler via cc.  */
  405.     cc -c allocatem.s
  406.     mv allocatem.o alloca.o
  407.     rm allocatem.s allocatem.c
  408. #endif /* HAVE_ALLOCA */
  409. #endif /* not C_ALLOCA */
  410.  
  411. /* Nearly all the following files depend on lisp.h,
  412.    but it is not included as a dependency because
  413.    it is so often changed in ways that do not require any recompilation
  414.    and so rarely changed in ways that do require any.  */
  415.  
  416. abbrev.o : abbrev.c buffer.h commands.h config.h 
  417. buffer.o : buffer.c syntax.h buffer.h commands.h window.h config.h 
  418. callint.o : callint.c window.h commands.h buffer.h config.h 
  419. callproc.o : callproc.c paths.h buffer.h commands.h config.h 
  420. casefiddle.o : casefiddle.c syntax.h commands.h buffer.h config.h 
  421. cm.o : cm.c cm.h termhooks.h config.h
  422. cmds.o : cmds.c syntax.h buffer.h commands.h config.h 
  423. crt0.o : crt0.c config.h
  424.     $(CC) -c $(CFLAGS) C_SWITCH_ASM crt0.c
  425. dired.o : dired.c commands.h buffer.h config.h 
  426. dispnew.o : dispnew.c commands.h window.h buffer.h dispextern.h termchar.h termopts.h cm.h config.h
  427. doc.o : doc.c buffer.h config.h paths.h
  428. doprnt.o : doprnt.c
  429. editfns.o : editfns.c window.h buffer.h config.h 
  430. emacs.o : emacs.c commands.h config.h 
  431. #ifdef MAINTAIN_ENVIRONMENT
  432. environ.o : environ.c buffer.h commands.h config.h
  433. #endif MAINTAIN_ENVIRONMENT
  434. fileio.o : fileio.c window.h buffer.h config.h 
  435. filelock.o : filelock.c buffer.h paths.h config.h
  436. filemode.o : filemode.c 
  437. indent.o : indent.c window.h indent.h buffer.h config.h termchar.h termopts.h
  438. insdel.o : insdel.c window.h buffer.h config.h 
  439. keyboard.o : keyboard.c termchar.h termhooks.h termopts.h buffer.h commands.h window.h macros.h config.h 
  440. keymap.o : keymap.c buffer.h commands.h config.h 
  441. lastfile.o : lastfile.c 
  442. macros.o : macros.c window.h buffer.h commands.h macros.h config.h
  443. malloc.o : malloc.c config.h
  444. marker.o : marker.c buffer.h config.h 
  445. minibuf.o : minibuf.c syntax.h window.h buffer.h commands.h config.h 
  446. mocklisp.o : mocklisp.c buffer.h config.h
  447. process.o : process.c process.h buffer.h window.h termhooks.h termopts.h commands.h config.h 
  448. regex.o : regex.c syntax.h buffer.h config.h regex.h 
  449. scroll.o : scroll.c termchar.h config.h dispextern.h termhooks.h
  450. search.o : search.c regex.h commands.h buffer.h syntax.h config.h 
  451. syntax.o : syntax.c syntax.h buffer.h commands.h config.h 
  452. sysdep.o : sysdep.c config.h dispextern.h termhooks.h termchar.h termopts.h window.h
  453. term.o : term.c termchar.h termhooks.h termopts.h config.h cm.h
  454. termcap.o : termcap.c config.h
  455. terminfo.o : terminfo.c config.h
  456. tparam.o : tparam.c config.h
  457. undo.o : undo.c buffer.h commands.h config.h 
  458. UNEXEC : config.h
  459. window.o : window.c indent.h commands.h window.h buffer.h config.h termchar.h
  460. xdisp.o : xdisp.c macros.h commands.h indent.h buffer.h dispextern.h termchar.h window.h config.h 
  461. xfns.o : xfns.c xterm.h window.h config.h
  462. xmenu.o : xmenu.c xterm.h window.h config.h
  463. xterm.o : xterm.c xterm.h termhooks.h termopts.h termchar.h \
  464.  dispextern.h config.h sink.h sinkmask.h
  465.  
  466. x11fns.o : x11fns.c window.h x11term.h dispextern.h termchar.h config.h
  467. x11term.o : x11term.c x11term.h termhooks.h termopts.h termchar.h \
  468.  dispextern.h config.h sink.h sinkmask.h
  469.  
  470. /* The files of Lisp proper */
  471.  
  472. alloc.o : alloc.c window.h buffer.h config.h 
  473. bytecode.o : bytecode.c buffer.h config.h 
  474. data.o : data.c buffer.h config.h 
  475. eval.o : eval.c commands.h config.h
  476. fns.o : fns.c buffer.h commands.h config.h
  477. print.o : print.c process.h window.h buffer.h dispextern.h termchar.h config.h 
  478. lread.o : lread.c buffer.h paths.h config.h 
  479.  
  480. /* System-specific programs to be made.
  481.    OTHER_FILES, OBJECTS_SYSTEM and OBJECTS_MACHINE
  482.    select which of these should be compiled.  */
  483.  
  484. sunfns.o  : sunfns.c buffer.h config.h
  485.  
  486. ${etcdir}emacstool: ${etcdir}emacstool.c
  487.     cd ${etcdir}; make ${MFLAGS} emacstool
  488.